/*
 * @Author: mia.chen mia.chen@webpowerchina.com
 * @Date: 2023-12-04 10:22:07
 * @LastEditors: wujingjing
 * @LastEditTime: 2024-01-02 13:01:13
 * @FilePath: /dzh/src/api/common.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { request } from "@/api/request";
import { LINKS } from "@/api/link";
type OssProps = {
  file: File;
  //模块名称
  module: string;
};

// 登录
export const signIn = function (data) {
  return request(`${LINKS.Account}/manage/v1/account/login`, {
    method: "post",
    data,
  });
};

export const getEnvApi = function () {
  return request(`${LINKS.V1_custom}/oss-file/env`);
};

/**
 * 字典
 * @param params type: 字典类型 1员工
 * @returns
 */
export const getDictList = function (params: any) {
  return request(`${LINKS.DICT}`, {
    params,
  });
};
/**
 * 上传oss
 */
export const uploadOss = function (data: OssProps) {
  return request(`${LINKS.V1_custom}/oss-file/upload`, {
    method: "post",
    headers: { "content-type": "multipart/form-data" },
    data: data,
  });
};
